<?php defined('SYSPATH') or die('No direct script access.');

class Controller_Private extends Controller_Template {
	
	public function before(){
		parent::before();
	}
	
	public function after(){
		parent::after();
	}
	
	public function action_index()
	{
		;
	}
	
	public function action_action(){
		$this->ajax->fail('参数不正确')->json();
		if (($post = $this->post) && ($id = $post['what'])){
			switch ($post['how']){
				case 'del':
					$result = MYSQL::factory($post['where'],$id)->delete()->exec();
					if ($result) $this->ajax->success('删除成功');
					break;
				case 'position':
					$result = lib_position::factory($post['where'],$id)->{$post['direction']}();
					if ($result) $this->ajax->success('排序成功');
					else $this->ajax->fail(lib_message::get());
					break;
				default:{$this->ajax->fail('没有找到处理方法');}
			}
		}
	}

} // End Welcome
